package com.risen.test.controller;

import com.risen.test.pojo.CoreAccount;
import com.risen.test.service.CoreAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @auther lmj
 * @date 2019/8/8
 */
@RestController
@RequestMapping("/login")
public class CoreAccountController {

    @Autowired
    private CoreAccountService coreAccountService;
    @RequestMapping("/selectByNameAndPwd")
    public Map<String,Object> selectByNameAndPwd(@RequestBody Map map1){
//        System.out.println(coreAccount.getCRACT_CODE()+"111111111111111111111111111111111111111111111111111111");
//        // 给前台一个参数，来判断登录成功或者失败
        Map<String,Object> map = new HashMap<>();
//        CoreAccount account = coreAccountService.selectByNameAndPwd(coreAccount);
//        if(account == null){
//            // 01代表用户名和密码错误
//            map.put("error","01");
//        }else{
//            map.put("success","00");
//        }
//        map.put("model", coreAccount);
        return map;
    }
}
